package com.kaishengit.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.BookService;
import service.BookTypeService;

import com.kaishengit.entity.Book;
import com.kaishengit.entity.BookType;
import com.kaishengit.util.web.ServletUtil;

public class UserIndex extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private BookTypeService serviceBookType=new BookTypeService();
	private BookService serviceBook=new BookService();
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		List<BookType> listBookType=serviceBookType.selectAll();
		List<Book> listBook=serviceBook.selectAll();
		
		ServletUtil.setRequestAttribute(request, "listBookType", listBookType);
		ServletUtil.setRequestAttribute(request, "listBook", listBook);
		ServletUtil.forward(request, response, "/index");
	}

}
